<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/assets/jquery_mobile/jquery.mobile-1.4.5.min.css">
<script src="/assets/js/jquery-1.8.1.min.js"></script>
<script src="/assets/jquery_mobile/jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript">
function ffdetect(){
	var poem = $("#poem").val();
	poem = poem.replace(/\ +/g,"").replace(/[\r\n\s]/g,"")
     .replace(/[\ |\~|\`|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\:|\"|\'|\<|\>|\/]/g,"");
	if(poem.length == 24 ){
		//五言绝句
		window.location.href="/ff/ffdetect?poem="+poem;
	}else{
		if(poem.length == 48 ){
			//五言律诗
			window.location.href="/fe/fedetect?poem="+poem;
		}else{
			if(poem.length == 32 ){
				//七言绝句
				window.location.href="/sf/sfdetect?poem="+poem;
			}else{
				if(poem.length == 64 ){
					//七言律诗
					window.location.href="/se/sedetect?poem="+poem;
				}else{
					alert("您输入的诗不符合字数规范或缺少符号！");
				}
			}
		}
	}
	
	
	
	
}

</script>
    
<title></title>
<style type="text/css">
textarea#poem {
    height: 300px !important;
}
</style>
</head>
<body>
<div data-role="page">

        <div data-role="header" data-position="fixed">

            <a href="#" data-role="button" data-icon="home" data-iconpos="notext"></a>
            <a href="#" data-role="button" data-icon="info" data-iconpos="notext"></a>
            <h1>诗词格律检验</h1>

        </div>
        	
        
         <div data-role="content" style="padding-top: 0.5em;">
         
			<label for="poem">请输入一首诗:</label>
				 <textarea cols="10" rows="10" name="poem" id="poem" placeholder="输入一首五言绝句/五言律诗/七言绝句/七言律诗"></textarea> 
				<input type="button" value="提交检验" onclick="ffdetect()">
		
         </div>
         
    <!--      <script type="text/javascript">
         
         	$(".inputnone").attr('data-role','none');  
         </script> -->
</div>



</body>
</html>